﻿
using Geotools.Geometries;
using AzukiMap.Map;
namespace AzukiMap.DataSource
{
    public abstract class DataSource
    {
        protected DataSourceTypes _type;
        protected string _name;
        protected int _srid;
        protected CoordinationUnits _coordUnit;
        protected GTPolygon _maxExtent;
        protected GeometryUtil _geoUtil;

        public string Name
        {
            get { return _name; }
        }

        public DataSourceTypes Type
        {
            get { return _type; }
        }

        public int Srid
        {
            get { return _srid; }
        }

        public CoordinationUnits CoordUnit
        {
            get { return _coordUnit; }
        }

        public GTPolygon MaxExtent
        {
            get { return _maxExtent; }
        }

        public DataSource(string name, DataSourceTypes type, int srid, CoordinationUnits coordUnit)
        {
            _name = name;
            _type = type;
            _srid = srid;
            _coordUnit = coordUnit;
            _geoUtil = new GeometryUtil();
            _maxExtent = _geoUtil.CreateExtentPolygon(0,0,0,0,0,0,0,0);
        }

        public bool Compare(DataSource other)
        {
            if (_name == other._name &&
                _type == other._type &&
                _srid == other._srid)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

    }
}
